package com.ktgj.customer.controller;

import com.ktgj.common.core.web.domain.AjaxResult;
import com.ktgj.customer.domain.dto.CalculationDTO;
import com.ktgj.customer.domain.vo.CalculationVO;
import com.ktgj.customer.service.IUtilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/util")
public class UtilController {
    @Autowired
    private IUtilService utilService;

    /**
     * 计算接口
     */
    @PostMapping("/calculation")
    public AjaxResult calculation(@RequestBody CalculationVO calculationVO) {
        return AjaxResult.success(utilService.calculation(calculationVO));
    }

    /**
     * 计算接口(远程)
     */
    @PostMapping("/calculationRemotely")
    public CalculationDTO calculationRemotely(@RequestBody CalculationVO calculationVO) {
        return utilService.calculation(calculationVO);
    }
}
